package com.itheima.mapper;

import com.itheima.domain.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("select * from tb_student")
   List<Student> findAll();


    @Insert("insert into tb_student values (null,#{number},#{userName},#{birthday},#{address})")
    void save(Student student);

    @Select("select * from tb_student where id=#{id}")
    Student findById(Integer id);


    @Update("update tb_student set number= #{number},user_name=#{userName},birthday=#{birthday},address=#{address} where id =# {id}")
    void update(Student student);

    @Delete("delete from tb_student where id=#{id}")
    void deleteById(Integer id);
}